package lab02.test03;

class Student {
    String name;
    int sno;
    int gradeComputer;
    int gradeMath;
    int gradeEnglish;
    int sum;
    int average;
    int high;
    int low;

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setSno(int sno) {
        this.sno = sno;
    }

    public int getSno() {
        return sno;
    }

    public void setGradeComputer(int gradeComputer) {
        this.gradeComputer = gradeComputer;
        //   System.out.println(gradeComputer);
    }

    public int getGradeComputer() {
        return gradeComputer;
    }

    public void setGradeMath(int gradeMath) {
        this.gradeMath = gradeMath;

    }

    public int getGradeMath() {
        return gradeMath;
    }

    public void setGradeEnglish(int gradeEnglish) {
        this.gradeEnglish = gradeEnglish;
    }

    public int getGradeEnglish() {
        return gradeEnglish;
    }

    public void setSum() {
        this.sum = gradeComputer + gradeEnglish + gradeMath;
    }

    public int getSum() {
        return sum;
    }

    public void setAverage() {
        this.average = (gradeComputer + gradeMath + gradeEnglish) / 3;
    }

    public int getAverage() {
        return average;
    }

    public void setHigh() {
        if (gradeEnglish > gradeMath) {
            if (gradeEnglish > gradeComputer) {
                this.high = gradeEnglish;
            }
        } else if (gradeMath > gradeComputer) {
            this.high = gradeMath;

        } else this.high = gradeComputer;
    }

    public int getHigh() {
        return high;
    }

    public void setLow() {
        if (gradeComputer < gradeEnglish) {
            if (gradeComputer < gradeMath) {
                this.low = gradeComputer;
            }
        } else if (gradeEnglish < gradeMath) {
            this.low = gradeEnglish;

        } else this.low = gradeMath;
    }

    public int getLow() {
        return low;
    }

    public void point() {
        System.out.println("name:" + name);
        System.out.println("Sno:" + sno);
        System.out.println("gradeComputer:" + gradeComputer);
        System.out.println("gradeEnglish:" + gradeEnglish);
        System.out.println("gradeMath:" + gradeMath);
        System.out.println("sum:" + sum);
        System.out.println("average:" + average);
        System.out.println("high:" + high);
        System.out.println("low:" + low);
    }

}
